<template>
	<view class="" @click="goOrder">
		<!-- 跳回 -->
	</view>
</template>

<script>
	const app = getApp();
	import { GroupWeChatNativeAction1 } from '@/api/group.js';
	export default {
		components: {},
		data() {
			return {
				
			}
		},
		onLoad(e) {
			console.log(e);
			// this.pay(e.Data,e.Order_Type)
		},
		methods: {
			async pay(Data,Order_Type){
				const res = await GroupWeChatNativeAction1({
					Data,
					Order_Type,
					Collection_Type: "微信支付-移动",
				});
				if (res.result_msg == "SUCCESS") {
					let _this = this
					let appId = res.sdk_appid;
					let timeStamp = res.sdk_timestamp + '';
					let nonceStr = res.sdk_noncestr;
					let packageX = res.sdk_package;
					let signType = res.sdk_signtype;
					let paySign = res.sdk_paysign;
					uni.hideLoading();
					uni.requestPayment({
						provider: 'wxpay',
						appId: appId,
						timeStamp: timeStamp,
						nonceStr: nonceStr,
						package: packageX,
						signType: signType,
						paySign: paySign,
						success: function(res) {
							uni.showToast({
								title: '支付成功!',
								icon: 'success',
								success() {
									console.log('支付成功');
									uni.showToast({
										title: '支付成功！',
										icon: 'error'
									})
								}
							})
						},
						fail: function(err) {
							uni.showToast({
								title: '已取消！',
								icon: 'error'
							})
						},
						//调起支付后打开懒加载
						complete: () => {
							this.loading = false
							uni.hideLoading();
						}
					})
				}
			}
			// goOrder(){
			// 	window.location.href=''
			// }
		}
	}
</script>

<style>
</style>